Description
| A method throws a SQLConnectionException when a database connection fails. The most likely causes for such a failure are:
Invalid user name.
Invalid password.
Any attempts to use the RelationView will fail.
When a dbANYWHERE Server catches a SQLConnectionException:
- If the object implementing the Logon interface registered itself with the Session's LogonHandler, then the dbANYWHERE Server calls logonFailed. Based on logonFailed's return value, the dbANYWHERE Server does one of the following:
If logonFailed returns True (which means that the user changed the user name and/or password), the dbANYWHERE Server tries to create the view again. The process (SQLConnectionException/logonFailed) repeats until the dbANYWHERE Server successfully recreates the view.
If logonFailed returns False (which means that the user canceled the operation), the dbANYWHERE Server rethrows SQLConnectionException.
- If the object implementing the Logon interface didn't register itself with the Session's LogonHandler, then the dbANYWHERE Server rethrows SQLConnectionException.
To handle a SQLConnectionException
- Catch the SQLConnectionException.
- If the object implementing the Logon interface registered itself with the Session's LogonHandler, let the dbANYWHERE Server handle the exception.
- If the object implementing the Logon interface didn't register itself with the Session's LogonHandler or if the dbANYWHERE Server rethrows the exception, do one of the following:
Terminate or restart the applet or application.
Invoke a method that handles this exception. (You need to create this method.)
|